#pragma once

#include "devuart.hpp"

class robot_station:private robot_devuart
{
public:
    static robot_station& instance();
    int get_data(uint8_t* buf, int len);

private:
    robot_station(const char* name, uint32_t boud);
    virtual ~robot_station(){};

    /* callback function must be static */
    friend void rxuart_thread_entry(void *parameter);
    friend void directive_run_thread_entry(void* parameter);

    /* used in instance() */
    static robot_station* p;

    uint8_t rec_databuf[64];
    uint8_t rec_databytes;

    struct rt_semaphore finish_rec_sem;
};

